package com.youlai.system.model.form;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

/**
 * @version 1.0
 * @Author zzps
 * @Date 2024/3/11 11:39
 * @注释
 */
@Schema(description = "分类表单对象")
@Data
public class CategoryForm {
    @Schema(description="分类ID")
    private Integer id;

    @Schema(description="父级分类ID")
    @NotNull(message = "父级分类ID不能为空")
    private Long parentId;

    @Schema(description="分类名称")
    @NotBlank(message = "分类名称不能为空")
    @Size(min = 1,max = 20, message = "分类名称长度为1-20")
    private String name;

    @Schema(description="状态")
    @NotNull(message = "状态不能为空  1:正常;0:禁用")
    @Min(value = 0, message = "状态最小值为0")
    @Max(value = 1, message = "状态最大值为1")
    private Integer status;

    @Schema(description="排序号")
    private Integer sortOrder;

    @Schema(description="是否是父分类")
    private Integer isParent;
}
